<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<link href="css/common.css" rel="stylesheet" type="text/css"/>
<link href="css/manage.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="js/YY_dialog.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script src="js/fileuploader.js" type="text/javascript"></script>
<script src="include/ckeditor/ckeditor.js" type="text/javascript"></script>
</head>
<body class="inner_page">
<div id="article_ctn">
	<label>标题</label><input class="title"/>
	<label>关键字</label><input class="keyword"/>
	<select class="catalog"><option></option></select>
	<label>日期</label><input class="write_time"/>
	<label>不显示</label><input type="checkbox"/>
	<textarea id="article_content"></textarea>
	<div id="file_upload"></div>
	<ul></ul>
	<button class="submit">提交</button>
</div>
<script>
function createUploader(){            
    var uploader = new qq.FileUploader({
        element: document.getElementById('file_upload'),
        action: 'save_file.php',
        debug: true,
        uploadButtonText: '添加附件',
        cancelButtonText: '取消',
        failUploadText: '失败',
        onSubmit: function(id, fileName){
        	uploader.setParams({
        		catalog_id: $('select[name="catalog_id"]').val()
     	    });
        },
        onComplete: function(id, fileName, responseJSON){
            
},
        params: {
            catalog_id: false
        }
    });
}
window.onload = createUploader;
var oCKeditor = CKEDITOR.replace( 'article_content',{ height: 500});
//获取分类
$.get('ajax_response.php',{type:'get_catalog',catalog_id:'article'},function(data){
	if (data.length>0){
		var str='';
		$(data).each(function(k,v){
			if (v.child_type=='0'){
				var str2='<ul>';
				$(data).each(function(ks,vs){
					if (vs.father_id==v.id){
						str2+='<li href="'+vs.link_dir+'">'+vs.catalog_name+'</li>';
					}
				});
				str2+='</ul>';
				str+='<li href="'+v.link_dir+'"><div>'+v.catalog_name+'</div><div class="ctr"><img src="image/spacer.gif"/></div>'+str2+'</li>';
			}
		});
		$('#nav_ctn>ul').html(str);
	}
},'json');

</script>
</body>
</html>